/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control_escolar;

import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JOptionPane;
import javax.swing.Icon;
import javax.swing.ImageIcon;

public class inicio extends javax.swing.JFrame {

    /**
     * Creates new form inicio
     */
    public inicio() {
        initComponents();
        setLocationRelativeTo(null);

        //iStudent();
        //isTeacher();
        //isMonitor();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    public void validaciones() {
    }

    void iStudent() {

        constancia_inicio.setVisible(false);
        reporte1.setVisible(false);
        reporte2.setVisible(true);
        reporte3.setVisible(false);
        kardex_inicio.setVisible(true);
        jMenu2.setVisible(false);
    }

    void isTeacher() {
        constancia_inicio.setVisible(false);
        reporte1.setVisible(false);
        reporte2.setVisible(true);
        reporte3.setVisible(false);
        kardex_inicio.setVisible(false);
        jMenu2.setVisible(true);
        alumno_inicio.setVisible(false);
        maestro_inicio.setVisible(false);
        materia_inicio.setVisible(false);
        Calificaciones.setVisible(true);
        jMenuItem6.setVisible(false);
        //jMenuItem7.setVisible(false);
    }

    void isMonitor() {
        constancia_inicio.setVisible(true);
        reporte1.setVisible(true);
        reporte2.setVisible(true);
        reporte3.setVisible(true);
        kardex_inicio.setVisible(true);
        jMenu2.setVisible(true);
        alumno_inicio.setVisible(true);
        maestro_inicio.setVisible(true);
        materia_inicio.setVisible(true);
        Calificaciones.setVisible(true);
        jMenuItem4.setVisible(true);
        jMenuItem6.setVisible(true);
        jMenuItem7.setVisible(true);
    }

    public Image getIconImage() {
        Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("umbrella-corp-2-icon.png"));
        return retValue;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jLabel2 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        reportes_inicio = new javax.swing.JMenu();
        constancia_inicio = new javax.swing.JMenuItem();
        reporte1 = new javax.swing.JMenuItem();
        reporte2 = new javax.swing.JMenuItem();
        reporte3 = new javax.swing.JMenuItem();
        kardex_inicio = new javax.swing.JMenuItem();
        Salir_inicio = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        agregar_inicio = new javax.swing.JMenu();
        alumno_inicio = new javax.swing.JMenuItem();
        maestro_inicio = new javax.swing.JMenuItem();
        materia_inicio = new javax.swing.JMenuItem();
        Calificaciones = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        jMenuItem2.setText("jMenuItem2");

        jMenuItem3.setText("jMenuItem3");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle(" SAECE V 1.0");
        setIconImage(getIconImage());
        setResizable(false);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fondo.jpg"))); // NOI18N

        jMenu1.setText("Archivo");

        reportes_inicio.setText("Reportes");

        constancia_inicio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_5, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        constancia_inicio.setText("constancia");
        constancia_inicio.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentHidden(java.awt.event.ComponentEvent evt) {
                constancia_inicioComponentHidden(evt);
            }
        });
        constancia_inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                constancia_inicioActionPerformed(evt);
            }
        });
        reportes_inicio.add(constancia_inicio);

        reporte1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        reporte1.setText("Constancia de Viaje");
        reporte1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reporte1ActionPerformed(evt);
            }
        });
        reportes_inicio.add(reporte1);

        reporte2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        reporte2.setText("Datos del Alumno");
        reporte2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reporte2ActionPerformed(evt);
            }
        });
        reportes_inicio.add(reporte2);

        reporte3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_3, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        reporte3.setText("Calificacion Parciales");
        reporte3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reporte3ActionPerformed(evt);
            }
        });
        reportes_inicio.add(reporte3);

        kardex_inicio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_4, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        kardex_inicio.setText("Kardex");
        kardex_inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                kardex_inicioActionPerformed(evt);
            }
        });
        reportes_inicio.add(kardex_inicio);

        jMenu1.add(reportes_inicio);

        Salir_inicio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
        Salir_inicio.setText("Salir");
        Salir_inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Salir_inicioActionPerformed(evt);
            }
        });
        jMenu1.add(Salir_inicio);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Editar");
        jMenu2.addMenuKeyListener(new javax.swing.event.MenuKeyListener() {
            public void menuKeyTyped(javax.swing.event.MenuKeyEvent evt) {
            }
            public void menuKeyPressed(javax.swing.event.MenuKeyEvent evt) {
                jMenu2MenuKeyPressed(evt);
            }
            public void menuKeyReleased(javax.swing.event.MenuKeyEvent evt) {
            }
        });

        agregar_inicio.setText("Agregar");

        alumno_inicio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        alumno_inicio.setText("Alumno");
        alumno_inicio.setName(""); // NOI18N
        alumno_inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                alumno_inicioActionPerformed(evt);
            }
        });
        agregar_inicio.add(alumno_inicio);

        maestro_inicio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.ALT_MASK));
        maestro_inicio.setText("Maestro");
        maestro_inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                maestro_inicioActionPerformed(evt);
            }
        });
        agregar_inicio.add(maestro_inicio);

        materia_inicio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK));
        materia_inicio.setText("Materia");
        materia_inicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                materia_inicioActionPerformed(evt);
            }
        });
        agregar_inicio.add(materia_inicio);

        Calificaciones.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        Calificaciones.setText("Agregar Calificaciones");
        Calificaciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CalificacionesActionPerformed(evt);
            }
        });
        agregar_inicio.add(Calificaciones);

        jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem4.setText("Alta Materias");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        agregar_inicio.add(jMenuItem4);

        jMenu2.add(agregar_inicio);

        jMenu4.setText("Generar horario");
        jMenu4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu4ActionPerformed(evt);
            }
        });

        jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem6.setText("Alumno");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem6);

        jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem7.setText("Maestro");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem7);

        jMenu2.add(jMenu4);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Acerca");

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("Equipo");
        jMenuItem1.setName("equipo"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem1);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void alumno_inicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_alumno_inicioActionPerformed
        // TODO add your handling code here:
        Alumno();
    }//GEN-LAST:event_alumno_inicioActionPerformed

    private void kardex_inicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_kardex_inicioActionPerformed
        // TODO add your handling code here:
        new Busqueda_kardex().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_kardex_inicioActionPerformed

    private void Salir_inicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Salir_inicioActionPerformed
        // TODO add your handling code here:
        Salir();
    }//GEN-LAST:event_Salir_inicioActionPerformed

    private void maestro_inicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_maestro_inicioActionPerformed
        // TODO add your handling code here:
        new maestro().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_maestro_inicioActionPerformed

    private void materia_inicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_materia_inicioActionPerformed
        // TODO add your handling code here:
        new materias().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_materia_inicioActionPerformed

    private void reporte1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reporte1ActionPerformed
        // TODO add your handling code here:
        new Busqueda_reporte1().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_reporte1ActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        new desarrolladores().setVisible(true);
        this.setVisible(false);

    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void reporte3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reporte3ActionPerformed
        // TODO add your handling code here:
        new Busqueda_reporte3().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_reporte3ActionPerformed

    private void reporte2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reporte2ActionPerformed
        // TODO add your handling code here:
        new Busqueda_reporte2().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_reporte2ActionPerformed

    private void CalificacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CalificacionesActionPerformed
        // TODO add your handling code here:
        new Maestro_calificaciones().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_CalificacionesActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        // TODO add your handling code here:
        new alta_materia().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenu2MenuKeyPressed(javax.swing.event.MenuKeyEvent evt) {//GEN-FIRST:event_jMenu2MenuKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu2MenuKeyPressed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
        new Horario().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenu4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu4ActionPerformed
        // TODO add your handling code here:
        new Horario().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_jMenu4ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        // TODO add your handling code here:
        new Horario_Maestro().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void constancia_inicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_constancia_inicioActionPerformed
        new Busqueda_Constancias().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_constancia_inicioActionPerformed

    private void constancia_inicioComponentHidden(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_constancia_inicioComponentHidden
    }//GEN-LAST:event_constancia_inicioComponentHidden

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new inicio().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JMenuItem Calificaciones;
    private javax.swing.JMenuItem Salir_inicio;
    public static javax.swing.JMenu agregar_inicio;
    public static javax.swing.JMenuItem alumno_inicio;
    public static javax.swing.JMenuItem constancia_inicio;
    private javax.swing.JLabel jLabel2;
    public static javax.swing.JMenu jMenu1;
    public static javax.swing.JMenu jMenu2;
    public static javax.swing.JMenu jMenu3;
    public static javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    public static javax.swing.JMenuItem jMenuItem4;
    public static javax.swing.JMenuItem jMenuItem6;
    public static javax.swing.JMenuItem jMenuItem7;
    public static javax.swing.JMenuItem kardex_inicio;
    public static javax.swing.JMenuItem maestro_inicio;
    public static javax.swing.JMenuItem materia_inicio;
    public static javax.swing.JMenuItem reporte1;
    public static javax.swing.JMenuItem reporte2;
    public static javax.swing.JMenuItem reporte3;
    private javax.swing.JMenu reportes_inicio;
    // End of variables declaration//GEN-END:variables

    private void Alumno() {
        //JOptionPane.showMessageDialog(null,"Ha elegido el Reprote de Alumons");
        new alumno().setVisible(true);
        this.setVisible(false);
    }

    private void Salir() {
        Icon icono = new ImageIcon("src/tracker-icono-6989-48.png");
        JOptionPane.showMessageDialog(null, " © Copyright\n All rights reserved ", "Derechos Reservados", JOptionPane.PLAIN_MESSAGE, icono);
        System.exit(1);
    }
}
